<!DOCTYPE html>
<html ng-app="app" lang="en">
    <head>
        <meta charset="UTF-8">
        <title ng-bind="title"></title>
        <link rel="stylesheet" href="../../style/css/bootstrap.css">
        <link rel="stylesheet" href="../../style/css/matrix-style.css">
        <link rel="stylesheet" href="select.css">
        <script src="../../../node_modules/angular/angular.js"></script>
        <script src="../../a.ui.js"></script>
        <script src="../common/outside-click.js"></script>
        <script src="../common/store.js"></script>
        <script src="select.js"></script>
        <script>
            // bootstrap app
            var app = angular.module('app', ['a.ui']);
            app.run(function ($rootScope) {
                $rootScope.title = 'Select';
                $rootScope.data = [{
                    name : 'Choice 1',
                    value: 0
                }, {
                    name : 'Choice 2',
                    value: 1
                }, {
                    name : 'Choice 3',
                    value: 2
                }, {
                    name : 'Choice 4',
                    value: 3
                }, {
                    name : 'Choice 5',
                    value: 4
                }, {
                    name : 'Choice 6',
                    value: 5
                }, {
                    name : 'Choice 7',
                    value: 6
                }, {
                    name : 'Choice 8',
                    value: 7
                }, {
                    name : 'Choice 9',
                    value: 8
                }];
            });
        </script>
    </head>
    <body>
        <div class="container">
            <h1 class="text-center" ng-bind="title"></h1>
            <h6 class="ui left floated header">静态数据:</h6>
            <a-select ng-model="select"
                       data="data"
                       display-field="name"
                       value-field="value">
            </a-select>
            <input type="number" min="0" max="8" ng-model="select">
            <span ng-bind="select|json"></span>
            <hr>
            <h6>动态级联数据:</h6>
            <a-select ng-model="select1"
                       data="data"
                       display-field="name"
                       ng-init="select1={name : 'Choice 6',value: 5}">
            </a-select>
            <a-select ng-model="subjectId"
                       api="select.demo.json"
                       param="select1"
                       display-field="name"
                       value-field="id"
                       multiple="true">
            </a-select>
            结果: <span ng-bind="subjectId|json"></span>
        </div>
    </body>
</html>